]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screencast: Don't leak recorders on failure
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 3 Oct 2014 14:49:21 +0000 (16:49 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 3 Oct 2014 15:08:56 +0000 (17:08 +0200)
ShellRecorder.record() may fail, remove the recorder from the map
in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=737846

js/ui/screencast.js

index d1ccc5be7faa78d10ee40af24bbf31cd8f13476b..def5dc9faa1a45b5054ce3435218d5dcfcd8c0dd 100644 (file)
@@ -117,6 +117,8 @@ const ScreencastService = new Lang.Class({
             this._applyOptionalParameters(recorder, options);
             let [success, fileName] = recorder.record();
             returnValue = [success, fileName ? fileName : ''];
+            if (!success)
+                this._stopRecordingForSender(sender);
         }
 
         invocation.return_value(GLib.Variant.new('(bs)', returnValue));
@@ -150,6 +152,8 @@ const ScreencastService = new Lang.Class({
             this._applyOptionalParameters(recorder, options);
             let [success, fileName] = recorder.record();
             returnValue = [success, fileName ? fileName : ''];
+            if (!success)
+                this._stopRecordingForSender(sender);
         }
 
         invocation.return_value(GLib.Variant.new('(bs)', returnValue));